<script type="text/javascript">
$(document).ready(function() {
        $("#elapsed").hide();
        $("#upcomingLink").click(function() {
                $("#upcoming").show();
                $("#elapsed").hide();
        });
        $("#elapsedLink").click(function() {
                $("#upcoming").hide();
                $("#elapsed").show();
        });
});
</script>
<?php $pid = Yii::app()->request->getParam('pid');?>
<div class="clear"></div>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/meeting.css" />
<div id="than">
    <img src="<?php echo Html::imageUrl("muiten.png")?>" width="27" height="26"; style="float:left">
                <div id="textxanhdam">Notebooks </div>
 </div>
                <div class="padding15"></div>                          
                <!-- Begin leftsidebar -->                  
                <div id="leftSidebar">
                        <div id="leftWrapper">
                                <div class="padding20"></div>
                                <button type="button" class="scheduleMeeting">Schedule Meeting</button>
                                <div class="padding20"></div>
                                <a href="#" id="upcomingLink">Upcoming Meetings</a>
                                <div class="padding10"></div>
                                <a href="#" id="elapsedLink">Elapsed Meetings</a>
                        </div>
                </div>
                <!-- End left sidebar -->
               
                <!-- Begin rightSidebar -->
                <div id="rightSidebar">
                        <div id="rightHeader">
                                <h2>Meetings</h2>
                                <button type="button" id="rightHeaderBtn" onclick="javascript:window.location ='<?php echo Yii::app()->controller->createUrl("/meeting/add/", array("pid"=>$pid));?>'">Schedule Meeting</button>
                        </div>
                       
                        <!-- Begin rightWrapper -->
                        <div id="rightWrapper">
                                <!-- Begin upcoming metting -->
                                <div id="upcoming">
                                        <div class="umHeader">
                                                <h3>Upcoming meetings</h3>
                                        </div>
                                       	
                                       		
                                       <?php 
                                       		//var_dump($schedules);
                                       		if(isset($schedules['TODAY'])) {?>
                                        <!-- Begin block -->
                                        <div class="umBlock today">
                                                <div class="umDate umDateToday">
                                                        Today
                                                </div>
                                                <?php foreach ($schedules['TODAY'] as $schedule) {?>
                                                <div class="umRow">
                                                        <h4><?php echo $schedule['modelSchedule']->schedule_subject;?></h4>
                                                        <p>Location: <?php echo $schedule['modelMeeting']->meeting_location;?></p>
                                                        <p>Attendees:
                                                        	<?php
                                                        	if(isset($schedule['modelMeetingUsers'])) 
	                                                        	foreach ($schedule['modelMeetingUsers'] as $modelMeetingUser) {
																echo $modelMeetingUser->meetingUserAttendingUser->user_name.", ";
                                                			}?>	    
                                                        </p>
                                                        <a href="<?php echo Yii::app()->controller->createUrl("/meeting/edit/", array('mid' => $schedule['modelMeeting']->meeting_id, 'pid' => $pid))?>">Edit</a> | 
                                                        <a href="<?php echo Yii::app()->controller->createUrl("/meeting/del/", array('mid' => $schedule['modelMeeting']->meeting_id, 'pid' => $pid))?>" onClick='js: return confirm("Are you sure");'>Delete</a>
                                                        <div class="mtDuration">
                                                                <h4>
                                                                	<?php 
                                                                		$timestamp = CDateTimeParser::parse($schedule['modelMeeting']->meeting_start_date,'yyyy-MM-dd hh:mm:ss');
                                                                		echo date('H i', $timestamp);
                                                                	?>
                                                                </h4>
                                                                <p>(Duration - <?php echo Html::duration($schedule['modelMeeting']->meeting_start_date, $schedule['modelMeeting']->meeting_end_date)?> hrs)</p>
                                                        </div>
                                                </div>
                                               	<?php }?>
                                                
                                        </div>
                                        <!-- End block -->
                                       <?php }?>
                                       
                                       <?php if(isset($schedules['TOMORROW'])) {?>
                                        <!-- Begin block -->
                                        <div class="umBlock">
                                                <div class="umDate umDateTomorrow">
                                                        Tomorrow
                                                </div>
                                                <?php foreach ($schedules['TOMORROW'] as $schedule) {?>
                                                <div class="umRow">
                                                        <h4><?php echo $schedule['modelSchedule']->schedule_subject;?></h4>
                                                        <p>Location: <?php echo $schedule['modelMeeting']->meeting_location;?></p>
                                                        <p>Attendees: 
                                                        <?php
                                                        	if(isset($schedule['modelMeetingUsers'])) 
	                                                        	foreach ($schedule['modelMeetingUsers'] as $modelMeetingUser) {
																echo $modelMeetingUser->meetingUserAttendingUser->user_name.", ";
                                                			}?>	                                                        	
                                                        </p>
                                                        <a href="<?php echo Yii::app()->controller->createUrl("/meeting/edit/", array('mid' => $schedule['modelMeeting']->meeting_id, 'pid' => $pid))?>">Edit</a> | 
                                                        <a href="<?php echo Yii::app()->controller->createUrl("/meeting/del/", array('mid' => $schedule['modelMeeting']->meeting_id, 'pid' => $pid))?>" onClick='js: return confirm("Are you sure");'>Delete</a>
                                                        <div class="mtDuration">
                                                                <h4>
                                                                	<?php 
                                                                		$timestamp = CDateTimeParser::parse($schedule['modelMeeting']->meeting_start_date,'yyyy-MM-dd hh:mm:ss');
                                                                		echo date('H i', $timestamp);
                                                                	?>
                                                                </h4>
                                                                <p>(Duration - <?php echo Html::duration($schedule['modelMeeting']->meeting_start_date, $schedule['modelMeeting']->meeting_end_date)?> hrs)</p>
                                                        </div>
                                                </div>
                                                <?php }?>
                                        </div>
                                        <!-- End block -->
                                       <?php }?>
                                       
                                       <?php if(isset($schedules['LATER'])) {?>
                                        <!-- Begin block -->
                                        <div class="umBlock">
                                                <div class="umDate umDateLater">
                                                        Later
                                                </div>
                                                <?php foreach ($schedules['LATER'] as $schedule) {?>
                                                <div class="umRow">
                                                        <h4><?php echo $schedule['modelSchedule']->schedule_subject;?><span style="font-size:12px;color:#848484"> on</span> 
	                                                        <span class="umTime">
	                                                        	<?php 
                                                                	$timestamp = CDateTimeParser::parse($schedule['modelMeeting']->meeting_start_date,'yyyy-MM-dd hh:mm:ss');
                                                                	echo date('Y/m/d', $timestamp);
                                                                ?>
	                                                        </span>
                                                        </h4>
                                                        <p>Location: <?php echo $schedule['modelMeeting']->meeting_location;?></p>
                                                        <p>Attendees: 
                                                        <?php
                                                        	if(isset($schedule['modelMeetingUsers'])) 
	                                                        	foreach ($schedule['modelMeetingUsers'] as $modelMeetingUser) {
																echo $modelMeetingUser->meetingUserAttendingUser->user_name.", ";
                                                			}?>	     
                                                        </p>
                                                        <a href="<?php echo Yii::app()->controller->createUrl("/meeting/edit/", array('mid' => $schedule['modelMeeting']->meeting_id, 'pid' => $pid))?>">Edit</a> | 
                                                        <a href="<?php echo Yii::app()->controller->createUrl("/meeting/del/", array('mid' => $schedule['modelMeeting']->meeting_id, 'pid' => $pid))?>" onClick='js: return confirm("Are you sure");'>Delete</a>
                                                        <div class="mtDuration">
                                                                <h4>
                                                                	<?php 
                                                                		$timestamp = CDateTimeParser::parse($schedule['modelMeeting']->meeting_start_date,'yyyy-MM-dd hh:mm:ss');
                                                                		echo date('H i', $timestamp);
                                                                	?>
                                                                </h4>
                                                                <p>(Duration - <?php echo Html::duration($schedule['modelMeeting']->meeting_start_date, $schedule['modelMeeting']->meeting_end_date)?> hrs)</p>
                                                        </div>
                                                </div>
                                               <?php }?>
                                                
                                        </div>
                                        <!-- End block -->
                                        <?php }?>
                                </div>
                                <!-- End upcoming meeting  -->
                                
                               
                                <!-- Begin elapsed meeting -->
                                <div id="elapsed">
                                        <div class="emHeader">
                                                <h3>Elased meeting</h3>
                                        </div>
                                        <?php if(isset($schedules['ELAPSED'])) {
                                        foreach ($schedules['ELAPSED'] as $schedule) {?>
                                        <div class="emBlock">
                                                <h4><?php echo $schedule['modelSchedule']->schedule_subject;?> <span style="font-size:12px;color:#848484"> on</span> 
	                                                <span class="emTime">
	                                                <?php 
                                                         $timestamp = CDateTimeParser::parse($schedule['modelMeeting']->meeting_start_date,'yyyy-MM-dd hh:mm:ss');
                                                         echo date('Y/m/d', $timestamp);
                                                    ?>
	                                                </span>
                                                </h4>
                                                <p>Location: <?php echo $schedule['modelMeeting']->meeting_location;?></p>
                                                <p>Attendees: 
                                                 <?php
                                                        	if(isset($schedule['modelMeetingUsers'])) 
	                                                        	foreach ($schedule['modelMeetingUsers'] as $modelMeetingUser) {
																echo $modelMeetingUser->meetingUserAttendingUser->user_name.", ";
                                                			}?>
                                                </p>
                                                <a href="<?php echo Yii::app()->controller->createUrl("/meeting/edit/", array('mid' => $schedule['modelMeeting']->meeting_id, 'pid' => $pid))?>">Edit</a> | 
                                                <a href="<?php echo Yii::app()->controller->createUrl("/meeting/del/", array('mid' => $schedule['modelMeeting']->meeting_id, 'pid' => $pid))?>" onClick='js: return confirm("Are you sure");'>Delete</a>
                                                <div class="mtDuration">
                                                        <h4>
                                                        <?php 
                                                                		$timestamp = CDateTimeParser::parse($schedule['modelMeeting']->meeting_start_date,'yyyy-MM-dd hh:mm:ss');
                                                                		echo date('H i', $timestamp);
                                                                	?>
                                                        </h4>
                                                        <p>(Duration - <?php echo Html::duration($schedule['modelMeeting']->meeting_start_date, $schedule['modelMeeting']->meeting_end_date)?> hrs)</p>
                                                </div>
                                        </div>
                                       <?php }}?>
                                        
                                </div>
                                <!-- End elapsed meeting -->
                        </div>
                        <!-- End rightWrapper -->
                </div>
                <!-- End rightSidebar -->
    </div>

